<template>

   <PortalToFollowElem @register="register">
     <template #trigger >
        <Button type="text" @click.stop="handleOpen">大预言模型</Button>
     </template>
    <List size="small" bordered :data-source="listData">
        <template #renderItem="{item}">
            <ListItem>{{ item.name }}</ListItem>
        </template>
    </List>
   </PortalToFollowElem>

</template>
<script setup lang="ts" name="Test">
import PortalToFollowElem from './index.vue';
import { Button,List,ListItem } from 'ant-design-vue';
import { usePortalToFollow } from './usePortalToFollow';

const [register,{toggleOpen}] = usePortalToFollow();
const listData = [
    {name:'苹果',value:"30"},
    {name:'香蕉',value:"11"},
    {name:'李子',value:"45"},
    {name:'橘子',value:"67"},
]

function handleOpen() {
    toggleOpen();
}
</script>